﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAO_DTO_WS.DAO;
using DAO_DTO_WS.DTO;

namespace testPre
{
    public partial class DanhSachSanPham : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string page = Request.QueryString["page"];
            if (page == null)
                page = "1";
            List<SanPhamDTO> dsSanPham = SanPhamDAO.layDSSanPham();
            int count = dsSanPham.Count;
            int soTrang = int.Parse(page);
            HyperLink1.NavigateUrl = "ChiTietSanPham.aspx?MaSanPham=" + dsSanPham[soTrang - 1].MaSanPham.ToString();
            //Image1.ImageUrl =
            HyperLink2.NavigateUrl = "ChiTietSanPham.aspx?MaSanPham=" + dsSanPham[soTrang].MaSanPham.ToString();
            HyperLink3.NavigateUrl = "ChiTietSanPham.aspx?MaSanPham=" + dsSanPham[soTrang + 1].MaSanPham.ToString();
            HyperLink4.NavigateUrl = "ChiTietSanPham.aspx?MaSanPham=" + dsSanPham[soTrang + 2].MaSanPham.ToString();
            HyperLink5.NavigateUrl = "ChiTietSanPham.aspx?MaSanPham=" + dsSanPham[soTrang + 3].MaSanPham.ToString();
            HyperLink6.NavigateUrl = "ChiTietSanPham.aspx?MaSanPham=" + dsSanPham[soTrang + 4].MaSanPham.ToString();

        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {

        }
    }
}
